#include <iostream>
#include <ctime>

#define N 10

using namespace std;

void plug(int *a,int p,int pos);

int main( )
{
    int i,pos,a[N],p;

    srand((unsigned int) time(0));

    for(i=0;i<(N-1);i++)
    {
        a[i]=rand()%10;
        cout<<"a["<<i<<"]"<<a[i]<<"  ";
    }

    cout<<"enter the number which need pulged and postion"<<endl;

    cin>>p>>pos;

    plug(a,p,pos);

    for(i=0;i<N;i++)
    {
        cout<<"a["<<i<<"]"<<a[i]<<"  ";
    }

    cin>>i;
    return 0;
}

void plug(int *a,int p,int pos)
{
    int i;

    for(i=N-1;i>pos;i--) a[i]=a[i-1];
    
    a[pos]=p;
}
